Question: $f(x) = \begin{cases} \sin(x) & \text{for} ~~~~x\lt\dfrac\pi2 \\\\ \dfrac{2x}\pi & \text{for} ~~~~ x \geq\dfrac\pi2\end{cases}$ Evaluate the definite integral. $\int^\pi_{-\pi}f(x)\,dx = $ Choose 1 answer: Choose 1 answer: (Choice A) A $\dfrac{3\pi}4-1$ (Choice B) B $-\dfrac14$ (Choice C) C $\dfrac14$ (Choice D) D $1+\dfrac\pi2$
Splitting up the definite integral Since we're working with a piecewise function, we need to split the definite integral up into two pieces: $\phantom{=} \int^\pi_{-\pi}f(x)\,dx$ $= \int^\frac\pi2_{-\pi}f(x)\,dx + \int^\pi_{\frac\pi2}f(x)\,dx~~~~~~$ [Why did we split at pi/2?] $= \int^\frac\pi2_{-\pi}\sin(x)\,dx + \int^\pi_{\frac\pi2}\dfrac{2x}\pi\,dx ~~~~~~$ Evaluating each piece Next, let's evaluate each of these definite integrals one at a time. The first definite integral: $\begin{aligned} \int^\frac\pi2_{-\pi}\sin(x)\,dx~ &=-\cos(x)\Bigg|^{\frac\pi2}_{{-\pi}} \\\\ &= \left[-\cos\left( {\dfrac\pi2}\right)\right] - \left[-\cos({-\pi})\right] \\\\ &= \left[0\right] - \left[1\right] \\\\ &= {-1}\end{aligned}$ The second definite integral: $\begin{aligned} \int^\pi_{\frac\pi2}\dfrac{2x}\pi\,dx~ &=\dfrac{x^2}\pi\Bigg|^{\pi}_{{\frac\pi2}} \\\\ &= \left[\dfrac{\left( {\pi} \right)^2}{\pi}\right] - \left[\dfrac{\left( {\dfrac\pi2} \right)^2}{\pi}\right] \\\\ &= \left[\pi\right] -\left[\dfrac\pi4 \right] \\\\ &= {\dfrac{3\pi}4}\end{aligned}$ Putting the pieces together Now let's add these two pieces together to find the answer: $\phantom{=} \int^\frac\pi2_{-\pi}\sin(x)\,dx + \int^\pi_{\frac\pi2}\dfrac{2x}\pi\,dx$ $ = {-1} + {\dfrac{3\pi}4}$ $ = \dfrac{3\pi}4-1$ The answer $\int^\pi_{-\pi}f(x)\,dx =\dfrac{3\pi}4-1$